#pragma once

#include "kernel/domain/map_extend_types.h"
#include "kernel/interfaces/Result.h"
#include "kernel/interfaces/ILogger.h"
#include <QJsonObject>
#include <QString>
#include <memory>

namespace infrastructure {

class MapExtendLoader {
public:
    explicit MapExtendLoader(std::shared_ptr<kernel::ILogger> logger = nullptr);
    ~MapExtendLoader() = default;

    kernel::Result<kernel::MapExtendedData> loadExtendedData(const QString& itemName) const;

private:
    std::shared_ptr<kernel::ILogger> m_logger;

    kernel::Result<kernel::MapExtendedData> parseJson(const QJsonObject& rootObj) const;
    kernel::StationType stationTypeFromInt(int value) const;
};

}  // namespace infrastructure
